<?php
	
	$host = 'localhost';
// 	$user = 'hdchonlo_admin';
// 	$pass = '123456#hd';
// 	$db = 'hdchonlo_db';
	$user = 'root';
	$pass = '';
	$db = 'bee20564_chon';
	$file = 'hdlist';
	$csv_output='';
	$id	= $_REQUEST['id'];
	$link = mysql_connect($host, $user, $pass) or die("Can not connect." . mysql_error());
			
			mysql_select_db($db,$link) or die("Can not connect.");

	$result = mysql_query("SELECT * FROM  orders_movie,movie WHERE orders_movie.pro_id=movie.id AND orders_movie.bill='".$id."'");
	$i = 0;
	if (mysql_num_rows($result) > 0) {
		while ($row = mysql_fetch_array($result)) {
			$csv_output .= $row['mv_path'];
			$csv_output .="\n";
			$i++;
		}
	}

$filename = $file;

header("Content-type: application/doc.doc");
header("Content-disposition: doc" . date("Y-m-d") . ".doc");
header("Content-disposition: filename=".$filename.".doc");
print $csv_output;
exit;

?>
